package com.mayi.zds.dao;

import com.mayi.zds.entity.GoodsLabel;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 用于商品标签中间表的Dao接口
 * @author xh
 */
public interface GoodsLabelDao {
    /**
     * 用于添加商品标签中间表数据的持久层方法
     * @param goodsLabel
     */
    @Insert("insert into zds_goods_label values (#{goodsId},#{labelId})")
    public void add(GoodsLabel goodsLabel);

    /**
     * 通过商品id查询标签
     */
     @Select("select *from zds_goods_label where goods_id=#{goodsId}")
    @Results({@Result(property = "goodsId",column = "goods_id"),@Result(property = "labelId",column = "label_id")})
    public GoodsLabel selectLabel(@Param("goodsId") String goodsId);


}
